package com.imooc.framework.basic.jvm.model;

public class Factorial {

    public int fact(int n){
        int result;
        if(n == 1){
            return 1;
        }
        System.out.println(n);
        result = fact(n - 1) * n;
        System.out.println(result);
        return result;
    }

    public static void main(String[] args) {
        Factorial factorial = new Factorial();
        System.out.println("10的阶乘是 " +   factorial.fact(10));
    }
}
